package com.lft.examsys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lft.examsys.entity.Paper;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author ：Qingchen
 * @date ：Created in 2022/4/2 10:58
 * @description：试卷Mapper
 * @modified By：
 * @version: $
 */
@Mapper
public interface PaperMapper extends BaseMapper<Paper> {
    List<Map<String, Integer>> selectPaperCount();

    Boolean deleteItemId(Integer paperId, Integer itemId);

    Boolean insertPaperItem(Integer itemId, Integer paperId);

    Integer selectMaxId();

    List<Paper> selectPapers();

    Boolean insertScore(Integer userId, Integer paperId, Date time, Integer score);

    Integer selectUserIfExistExam(Integer paperId, Integer userId);

    Boolean deleteItem(Integer itemId);

    Page<Paper> getAllOrderByTime(Page<Paper> page);
}
